package cn.tedu.project.oa.sys.user.pojo.dto;

import cn.tedu.project.oa.sys.role.pojo.entity.Role;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.util.Date;
import java.util.List;

@Data
public class AddUserPara {
    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名",required = true)
    private String username;

    @NotNull(message = "密码不能为空")
//    @Size(min = 8, max = 20, message = "密码长度必须在8-20位之间")
//    @Pattern(
//            regexp = "^(?!\\d+$).{8,20}$",
//            message = "密码不能是纯数字"
//    )
    @Size(min = 4, max = 20, message = "密码长度必须在4-20位之间")
    @ApiModelProperty(value = "密码",required = true)
    private String password;

    // 邮箱校验：非空，格式校验
    @Email(message = "邮箱格式不正确")
    @ApiModelProperty(value = "邮箱",required = true)
    private String email;

    // 手机号校验：非空，使用正则表达式校验手机号格式
    @Pattern(regexp = "^\\+?[0-9]{10,15}$", message = "手机号码格式不正确")
    @NotBlank(message = "手机号不能为空")
    @ApiModelProperty(value = "手机号",required = true)
    private String phone;

    // 性别校验：取值范围为0或1
    @Min(value = 0, message = "性别用0或者1表示,0表示女性,1表示男性")
    @Max(value = 1, message = "性别用0或者1表示,0表示女性,1表示男性")
    @ApiModelProperty(value = "性别",required = true)
    private Integer gender;

    // 真实姓名校验：非空
    @NotBlank(message = "真实姓名不能为空")
    @Size(min=2,max=50,message="真实姓名长度必须在2到50之间")
    @ApiModelProperty(value = "真实姓名",required = true)
    private String fullName;

    @ApiModelProperty(value = "部门ID",required = true)
    private Long departmentId;

    @ApiModelProperty(value = "职位ID",required = true)
    private Long positionId;

    @ApiModelProperty(value = "创建人",required = true)
    private String createBy;

    @ApiModelProperty(value = "账号状态",required = true)
    private Integer status;

    @ApiModelProperty(value = "角色列表")
    private List<String> roles;
}
